package com.jiniutech.utils;

import org.junit.Test;

/**
 * @Author Hankauk
 * @Data 2020/7/19/019 12:11
 */
public class MybatisGeneratorUtil {
    @Test
    public void generateStatisticsModuleCodes() {
        String author = "Hankauk";
        String moduleName = "weixin";
        String[] tableNames = new String[]{
                "e_user"
        };

        DefaultMybatisPlusGenerator generator = new DefaultMybatisPlusGenerator();
        generator.setGenerateControllers(true);
        generator.setGenerateServices(true);
        generator.setGenerateMappers(true);
        generator.setGenerateXMLs(true);
        generator.setGenerateEntities(true);
        generator.setFileOverride(true);
        generator.setModuleName(moduleName);
        generator.setAuthor(author);
        generator.setConnectUrl("jdbc:mysql://192.168.52.130:3306/enterprise?useUnicode=true&characterEncoding=utf8");
        generator.setTableNames(tableNames);
        generator.setUserName("root");
        generator.setPassword("123456");
        generator.setDriverName("com.mysql.cj.jdbc.Driver");
        generator.execute();
    }
}
